package com.gr

class Profile {
	
	static belongsTo = User
	
	byte[] photo
	
	String fullName
	String bio
	String homepage
	String email
	String timezone
	String country
	String jabberAddress
	
	String skin
	
	static constraints = {
		fullName(nullable: true)
		bio(nullable: true, maxsize: 1000)
		homepage(nullable: true, url: true)
		email(nullable: true, email: true)
		photo(nullable: true, maxSize: 1000000)
		country(nullable: true)
		timezone(nullable: true)
		jabberAddress(nullable: true, email: true)
		skin(nullable: true, blank: true, inList: ['blues', 'nighttime'])
	}
	
	String toString() {
		"Profile for ${fullName} (${id})"
	}
	
	static mapping = {
		photo column: "photo_data", sqlType: "blob"
	}
}

